package com.cskaoyan.controller;

import com.cskaoyan.bean.common.BaseRespVo;
import com.cskaoyan.bean.vo.StatVO;
import com.cskaoyan.service.AdminStatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : qj
 * @since: 2022/10/12  18:28
 */
@RestController
@RequestMapping("admin/stat")
public class AdminStatController {
    @Autowired
    AdminStatService adminStatService;

    @GetMapping("user")
    public BaseRespVo statUser(){
        StatVO statVO = adminStatService.statUser();
        return BaseRespVo.ok(statVO);
    }

    @GetMapping("order")
    public BaseRespVo statOrder(){
        StatVO statVO = adminStatService.statOrder();
        return BaseRespVo.ok(statVO);
    }

    @GetMapping("goods")
    public BaseRespVo statGoods(){
        StatVO statVO = adminStatService.statGoods();
        return BaseRespVo.ok(statVO);
    }
}
